﻿<Window x:Class="LaunchPad.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Core="clr-namespace:LaunchPad.Core.Controls;assembly=LaunchPad.Core"
        xmlns:Audio="clr-namespace:LaunchPad.Core.Controls.Tracks;assembly=LaunchPad.Core"
        xmlns:Dock="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        Title="LaunchPad" Height="447" Width="948" mc:Ignorable="d" Icon="/LaunchPad;component/launchpad64.ico" WindowState="Maximized">

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <Menu Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Row="0">
            <MenuItem Header="File">
                <MenuItem Name="_newMenuItem" Command="New"/>
                <MenuItem Name="_openMenuItem" Header="Open..." Command="Open"/>
                <Separator/>
                <MenuItem Name="_saveMenuItem" Header="Save" Command="Save"/>
                <MenuItem Name="_saveAsMenuItem" Header="Save As..." Command="SaveAs"/>
                <Separator/>
                <MenuItem Name="_importAudioMenuItem" Header="Choose Audio..." Click="ImportAudioMenuItemClick" />
                <Separator/>
                <MenuItem Name="_exitMenuItem" Header="Exit" Click="ExitMenuItemClick"/>
            </MenuItem>
        </Menu>

        <Dock:DockingManager Grid.Row="1">
            <Dock:ResizingPanel>
                <Dock:DockablePane Dock:ResizingPanel.ResizeWidth="200">
                    <Dock:DockableContent Title="Network" >
                        <Core:NetworkControl Name="_networkControl"/>
                    </Dock:DockableContent>
                </Dock:DockablePane>
                <Dock:ResizingPanel Orientation="Vertical">
                    <Dock:DockablePane Dock:ResizingPanel.ResizeHeight="60" >
                        <Dock:DockableContent Title="Playback" MaxHeight="60" >
                            <Grid>
                                <Button Content="Play" Height="23" HorizontalAlignment="Left" Margin="12,8,0,0" Name="_playButton" VerticalAlignment="Top" Width="41" Click="PlayButtonClick" Grid.Row="1" IsEnabled="False" Focusable="False" />
                                <!--<GridSplitter Grid.Row="0" HorizontalAlignment="Stretch" Name="gridSplitter1" VerticalAlignment="Bottom" ResizeDirection="Auto" Height="2" ShowsPreview="True" />-->
                                <Label Grid.Row="1" Height="24" HorizontalAlignment="Left" Margin="106,8,0,0" Name="_timeLabel" VerticalAlignment="Top" Width="143" >
                                    <Label.Content>
                                        <Binding Path="Audio.Position" StringFormat="hh\\:mm\\:ss\\.f" />
                                    </Label.Content>
                                </Label>
                                <Button Content="Stop" Height="23" HorizontalAlignment="Left" Margin="59,8,0,0" Name="_stopButton" VerticalAlignment="Top" Width="41" Grid.Row="1" Click="StopButtonClick" IsEnabled="False" Focusable="False" />
                                <Button Content="Start Show..." Height="29" HorizontalAlignment="Right" Margin="0,6,6,0" Name="_startShowButton" VerticalAlignment="Top" Width="117" FontWeight="Bold" Click="StartShowButtonClick" IsEnabled="False" />
                            </Grid>
                        </Dock:DockableContent>
                    </Dock:DockablePane>
                    <Dock:DockablePane>
                        <Dock:DockableContent Title="Tracks">
                            <Audio:TrackStackControl Name="_nodeStack"
                                        AudioTrack="{Binding Path=AudioTrack}"
                                        Tracks="{Binding Path=Field.Tracks, Mode=TwoWay}" />
                        </Dock:DockableContent>
                    </Dock:DockablePane>
                    <Dock:DockablePane ShowHeader="False" Dock:ResizingPanel.ResizeHeight="80">
                        <Dock:DockableContent Name="_runningDock">
                            <Core:ShowControl Name="_runningControl" Abort="RunningDialogAbort" Pause="RunningDialogPause" Play="RunningDialogPlay"/>
                        </Dock:DockableContent>
                    </Dock:DockablePane>
                </Dock:ResizingPanel>

                <Dock:ResizingPanel Orientation="Vertical" Dock:ResizingPanel.ResizeWidth="340" >
         
                    <Dock:DockablePane>
                        <Dock:DockableContent Title="Products" >
                            <Core:LibraryControl Name="_library"/>
                        </Dock:DockableContent>
                    </Dock:DockablePane>

                    <Dock:DockablePane >
                        <Dock:DockableContent Title="Map" >
                            <Core:MapControl Name="_map" 
                                             Nodes="{Binding Path=Nodes}"  
                                             Effects="{Binding Path=Tracks}"/>
                        </Dock:DockableContent>
                    </Dock:DockablePane>
                </Dock:ResizingPanel>
            </Dock:ResizingPanel>
        </Dock:DockingManager>
    </Grid>
</Window>
